package teacher;
import base.Person;
import course.Course;
public class Teacher extends Person {
    private Course taughtCourse;

    public Teacher(String id, String name, String gender) {
        super(id, name, gender);
    }

    public void openCourse(Course course) {
        this.taughtCourse = course;
        System.out.println(name + " 成功开设《" + course.getName() + "》");
    }

    @Override
    public void showBasicInfo() {
        super.showBasicInfo();
        if (taughtCourse != null) {
            System.out.println("讲授课程：《" + taughtCourse.getName() + "》，上课时间：" + taughtCourse.getTime());
        }
    }
}